package cn.wolfcode.p2p.business.mapper;

import cn.wolfcode.p2p.base.qo.TransferCreditQueryObject;
import cn.wolfcode.p2p.business.domain.CreditTransfer;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CreditTransferMapper {

    int insert(CreditTransfer record);

    CreditTransfer selectByPrimaryKey(Long id);

    int updateByPrimaryKey(CreditTransfer record);

    List<CreditTransfer> listCanTransferCredit(Long id);

    /**
     * 获取准备转让的债权标
     * @param userId
     * @param bidId
     * @return
     */
    List<CreditTransfer> listReadyToTransferCredit(@Param("userId") Long userId, @Param("bidIds") Long[] bidId);

    /**
     * 改变明细中的转让状态
     * @param bidId
     * @param intrans
     */
    void changePaymentScheduleDetailIntransState(@Param("bidId") Long bidId, @Param("intrans") int intrans);

    List queryData(TransferCreditQueryObject qo);

    void changePaymentScheduleDetailInvestorId(@Param("bidId") Long bidId, @Param("investorId") Long investorId);

    CreditTransfer findNeedCancel(Long bidId);
}